package se.liu.johfa428.game.objects.intro;



import se.liu.oschi129.animation.animationspace.AnimationSpace;
import se.liu.oschi129.world.model.World;
import se.liu.oschi129.world.objects.WorldStaticObject;

/**
 * Generates the Intro background with moving clouds.
 * @author johfa428
 *
 */
public class ObjectMenuBackground extends WorldStaticObject {

	private boolean doOnce = false;
	public ObjectMenuBackground() {
		super(Type.SOFT, AnimationSpace.get("img_intro_background"), true, 0, 0, 320, 240);
		setDepth(1);
	
	}

	
	@Override public void performStepAction(World world) {
		
		if (!doOnce){
		ObjectCloud01 cloud01 = new ObjectCloud01(70, 0, 0, 1 );
		ObjectCloud02 cloud02 = new ObjectCloud02(70, 0, 0, 1.3);
		ObjectCloud01 cloud03 = new ObjectCloud01(70, 0, 0, 1.5);
//		ObjectMenuLogo staticIntroLogo = new ObjectMenuLogo(0,0,world.getWidth(),world.getHeight());
		
		
//		staticIntroLogo.setCenter();
		cloud01.setVisible(true);
		
//		world.addObjectSynchronized(staticIntroLogo);	
		world.addObjectSynchronized(cloud01);
		world.addObjectSynchronized(cloud02);
		world.addObjectSynchronized(cloud03);
	
		doOnce=true;
		}
	}


}
